package com.bestcem.xm.ticket.controller.vo.ticket;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * @author liheng
 * @version v1.0
 * @date 2021/8/30 20:19
 */
@Data
@JsonInclude
public class TicketPageVO implements Serializable {

    private static final long serialVersionUID = -4104738663086139879L;
    @JsonProperty("id")
    private String id;

    @JsonProperty("ticketNo")
    private String ticketNo;

    @JsonProperty("regionName")
    private String regionName;

    @JsonProperty("surveyTitle")
    private String surveyTitle;

    @JsonProperty("status")
    private Integer status;

    @JsonProperty("alertRuleIds")
    private List<String> alertRuleIds;

    @JsonProperty("alertRules")
    private List<AlertRule> alertRuleList;

    @JsonProperty("closedDT")
    private Date closedDate;

    @JsonProperty("ticketFailedTime")
    private Date ticketFailedTime;

    @JsonProperty("ticketFinishTime")
    private Date ticketFinishTime;

    @JsonProperty("hasFollowOverdue")
    private Boolean hasFollowOverdue;

    @JsonProperty("ticketDeadline")
    private Date ticketDeadline;

    @JsonProperty("followDeadline")
    private Date followDeadline;

    @JsonProperty("auditDeadline")
    private Date auditDeadline;

    @JsonProperty("hasAuditOverdue")
    private Boolean hasAuditOverdue;

    @JsonProperty("ttype")
    private Integer type;

    @JsonProperty("curFollowUserId")
    private List<String> curFollowUserId;

    @JsonProperty("created_id")
    private String createdId;

    @JsonProperty("created_dt")
    private Date createdDate;

    @JsonProperty("updated_dt")
    //@JsonFormat(pattern = "yyyy/MM/dd HH:mm:ss", timezone = "GMT+8")
    private Date updatedDate;

    /**
     * 处理人姓名
     */
    @JsonProperty("handler_name")
    private List<String> handlerName;

    /**
     * 创建人姓名
     */
    @JsonProperty("created_name")
    private String createdName;

    /**
     * 1-系统创建，2-手动创建（2.3版本新增）
     */
    @JsonProperty("operation_type")
    private Integer operationType;

    @JsonProperty("ticket_name")
    private String ticketName;

    /**
     * 工单满足的触发条件的名称
     * 2022-02-18 行动新增条件名称需求新增
     */
    @JsonProperty("trigger_names")
    private List<String> triggerNames;


    @Data
    @AllArgsConstructor
    @NoArgsConstructor
    public static class AlertRule implements Serializable {
        private static final long serialVersionUID = -2613037129614397406L;

        @JsonProperty("alertRuleTitle")
        private String alertRuleTitle;
        /**
         * 生成规则id
         */
        @JsonProperty("alertRuleId")
        private String alertRuleId;
    }
}
